#ifndef COLOR_SET_H
#define COLOR_SET_H

#include "wfnettypes.h"

#include <btime.h>
#include <icolorset.h>
#include <valuetype.h>

using namespace core;

namespace wfnet
{
class Arc;
class DynamicTypeManager;

class ColorSet : public net::IColorSet, public ValueType
{
public:
    ColorSet(const ColorSet& other);
    ~ColorSet();

    // IColorSet
    bool isTimed() const;
    void setTime(core::BasicTime& time);
    core::BasicTime getTime() const;

    // ValueType
    void setValue(const QVariant& value);
    QVariant getValue() const;

    QString name() const;
    bool matches(const Type& type) const;
    bool matches(const TypeName& name) const;

    ColorSet& operator=(const ColorSet& other);

    bool operator ==(const Type& type) const;
    bool operator !=(const Type& type) const;

    bool canConvert(const TypeValue& value) const;
    ValueKeywordMask keywordMask() const;

    bool hasIdentity() const;

    Type* copy() const;

    TypeName typeOf() const;
    const ValueType* getType() const;

protected:
    ColorSet(const QString& name, const ValueType& type, bool isTimed);

private:
    void copySupportedOperations();

public:
    static const TypeName NAME;

private:
    friend class Arc;
    friend class DynamicTypeManager;

    QString m_name;
    ValueType* m_type;
    bool m_isTimed;
    BasicTime m_time;
};

} // namespace wfnet

#endif
